# -*- coding: cp1252 -*-
#########################################################
#                                                       #
# Classe Gerada pelo PyGenerator - Gets e Sets v. 1.0   #
# Criado por Raphoka e Amigos                           #
#                                                       #
#########################################################
'''
Created on 14/10/2012

@author: Raphoka
'''

#####################
# -- CONSTRUTOR --  #
#####################
class Servico(object):
    '''
    classdocs
    '''




    def __init__(self):
        self.__Id = ''
        self.__descricao = ''
        self.__preco = ''

######################
# -- GETS E SETS --  #
######################

    def getId(self):
        return self.__Id
    def setId(self, Id):
        self.__Id = Id

        
    def getDescricao(self):
        return self.__descricao
    def setDescricao(self, descricao):
        self.__descricao = descricao

        
    def getPreco(self):
        return self.__preco
    def setPreco(self, preco):
        self.__preco = preco
        self.__converterPreco__()

        

#################
# -- METODOS -- #
#################

    def __converterPreco__(self):
        preco = self.__preco
        try:
            
            preco = preco.encode()
        except:
            pass
        if (isinstance(preco, str)):
            preco = preco.replace(',', '.')
            preco = float(preco)
            self.__preco=preco
        elif(isinstance(preco, float)):
            preco = str(preco)
            preco = preco.replace('.', ',')
            self.__preco=preco

    def __str__(self):
        m = '''
Objeto Tipo: Servico

Atributos:

id: %s
descricao: %s
preco: %s
''' %(self.__Id, self.__descricao, self.__preco)
        return m

        